package com.love.travel.service.impl;

import java.util.List;
import com.love.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.love.travel.mapper.TravelProductCommentMapper;
import com.love.travel.domain.TravelProductComment;
import com.love.travel.service.ITravelProductCommentService;

/**
 * 产品评价Service业务层处理
 * 
 * @author love
 * @date 2025-10-25
 */
@Service
public class TravelProductCommentServiceImpl implements ITravelProductCommentService 
{
    @Autowired
    private TravelProductCommentMapper travelProductCommentMapper;

    /**
     * 查询产品评价
     * 
     * @param commentId 产品评价主键
     * @return 产品评价
     */
    @Override
    public TravelProductComment selectTravelProductCommentByCommentId(Long commentId)
    {
        return travelProductCommentMapper.selectTravelProductCommentByCommentId(commentId);
    }

    /**
     * 查询产品评价列表
     * 
     * @param travelProductComment 产品评价
     * @return 产品评价
     */
    @Override
    public List<TravelProductComment> selectTravelProductCommentList(TravelProductComment travelProductComment)
    {
        return travelProductCommentMapper.selectTravelProductCommentList(travelProductComment);
    }

    /**
     * 新增产品评价
     * 
     * @param travelProductComment 产品评价
     * @return 结果
     */
    @Override
    public int insertTravelProductComment(TravelProductComment travelProductComment)
    {
        travelProductComment.setCreateTime(DateUtils.getNowDate());
        return travelProductCommentMapper.insertTravelProductComment(travelProductComment);
    }

    /**
     * 修改产品评价
     * 
     * @param travelProductComment 产品评价
     * @return 结果
     */
    @Override
    public int updateTravelProductComment(TravelProductComment travelProductComment)
    {
        travelProductComment.setUpdateTime(DateUtils.getNowDate());
        return travelProductCommentMapper.updateTravelProductComment(travelProductComment);
    }

    /**
     * 批量删除产品评价
     * 
     * @param commentIds 需要删除的产品评价主键
     * @return 结果
     */
    @Override
    public int deleteTravelProductCommentByCommentIds(Long[] commentIds)
    {
        return travelProductCommentMapper.deleteTravelProductCommentByCommentIds(commentIds);
    }

    /**
     * 删除产品评价信息
     * 
     * @param commentId 产品评价主键
     * @return 结果
     */
    @Override
    public int deleteTravelProductCommentByCommentId(Long commentId)
    {
        return travelProductCommentMapper.deleteTravelProductCommentByCommentId(commentId);
    }
}
